import axios from '@/utils/request/httpConfig'
const base = '/web'

/*Reference Request Encapsulation*/
// export const requestLogin = params => { return axios.post('/adminLogin', params).then(res => res.data);}

/*test*/
// export function requestTest(params) {
//     return axios.post('/web/tTeacherinfo/save', params)
// }
export const requestTest = params => { return axios.get(`${base}/tTeacherinfo/save`, { params: params }) }



export function getTree(params) {
    return axios.get('/treeTable', params)
}


/*role*/
export function roleList(params) {
    return axios.post(`${base}/role/list`, params)
}

export function roleDel(params) {
    return axios.post(`${base}/role/delBatch`, params)
}

export function roleAdd(params) {
    return axios.post(`${base}/role/save`, params)
}

export const roleTree = params => { return axios.get(`${base}/tUserRole/getUserTree`, { params: params }) }

export const roleTreesave = params => { return axios.get(`${base}/tUserRole/addUserRole`, { params: params }) }

export const roleLocksave = params => { return axios.get(`${base}/tRolePermission/addPerToRole`, { params: params }) }


/* user */
export function userList(params) {
    return axios.post(`${base}/tAreaUser/list`, params)
}

export function userSave(params) {
    return axios.post(`${base}/tAreaUser/save`, params)
}

export function userDel(params) {
    return axios.post(`${base}/tAreaUser/delBatch`, params)
}
// 编辑的时候获取角色类型
export function getRoles(params) {
    return axios.post(`${base}/role/getAll`, params)
}

/* userStu */
export function Student(params) {
    return axios.post(`${base}/tStudent/list`, params)
}

export function StuSave(params) {
    return axios.post(`${base}/tStudent/save`, params)
}

export function StuDel(params) {
    return axios.post(`${base}/tStudent/delBatch`, params)
}

/* userTea */
export function userTea(params) {
    return axios.post(`${base}/tTeacherinfo/list`, params)
}

export function userTeaSave(params) {
    return axios.post(`${base}/tTeacherinfo/save`, params)
}

export function userTeaDel(params) {
    return axios.post(`${base}/tTeacherinfo/delBatch`, params)
}

// 学科
export function couName(params) {
    return axios.get(`${base}/tCourseinfo/list/all`, params)
}


/* school */
export function schoolList(params) {
    return axios.post(`${base}/tSchoolinfo/list`, params)
}

export function schoolSave(params) {
    return axios.post(`${base}/tSchoolinfo/save`, params)
}

// 学段
export function phName(params) {
    return axios.get(`${base}/tPhaseinfo/list/all`, params)
}

export function schoolDel(params) {
    return axios.post(`${base}/tSchoolinfo/delBatch`, params)
}


/* logs */
export function logsList(params) {
    return axios.post(`${base}/tSystemLog/list`, params)
}


/* upload */
export function uploadStu(params) {
    return axios.post(`${base}/tStudent/importBatch`, params)
}

export function uploadTea(params) {
    return axios.post(`${base}/tTeacherinfo/importBatch`, params)
}


/* 校群 */
export function groupList(params) {
    return axios.post(`${base}/tSchoolGroup/list`, params)
}

export function groupSave(params) {
    return axios.post(`${base}/tSchoolGroup/save`, params)
}

export function groupDel(params) {
    return axios.post(`${base}/tSchoolGroup/delBatch`, params)
}

// 获取群主（所有中心校）
export function groupOwner(params) {
    return axios.get(`${base}/tSchoolGroup/centre/list`, params)
}

// 添加删除群成员树接口
export function membertreeSave(params) {
    return axios.post(`${base}/tGroupMember/save`, params)
}

// 群成员批量删除
export function memberDel(params) {
    return axios.post(`${base}/tGroupMember/delBatch`, params)
}

export function groupMemberList(params) {
    return axios.post(`${base}/tGroupMember/list`, params)
}


/* 互动教室 */
export function areaClassroomList(params) {
    return axios.post(`${base}/tInteractiveClassroom/area/list`, params)
}

export function schClassroomList(params) {
    return axios.post(`${base}/tInteractiveClassroom/list`, params)
}

export function classroomSave(params) {
    return axios.post(`${base}/tInteractiveClassroom/save`, params)
}


export function classroomDel(params) {
    return axios.post(`${base}/tInteractiveClassroom/delBatch`, params)
}

// 互动模板
export function formwork(params) {
    return axios.get(`${base}/tInteractiveClassroom/get/formwork`, params)
}

// 获取所有学校
export function allSchoolList(params) {
    return axios.get(`${base}/tSchoolinfo/all/sch/list`, params)
}

// 开关直播
export function classLiveStatus(params) {
    return axios.post(`${base}/tInteractiveClassroom/updateLiveStatus`, params)
}

// 开关推流
export function classFlow(params) {
    return axios.post(`${base}/tInteractiveClassroom/updateState`, params)
}



/* 学期管理 */
export function termList(params) {
    return axios.post(`${base}/tTerminfo/list`, params)
}

export function termSave(params) {
    return axios.post(`${base}/tTerminfo/save`, params)
}

export function termDel(params) {
    return axios.post(`${base}/tTerminfo/delBatch`, params)
}



/* 课程明细 */
export function classdetailList(params) {
    return axios.post(`${base}/tCurriculumPlan/list`, params)
}

/* 课程日历 */
export function riliList(params) {
    return axios.post(`${base}/tCurriculumPlan/plan/list`, params)
}

// 新增课程初始化数据
export function courseReady(params) {
    return axios.post(`${base}/tCurriculumPlan/initialization`, params)
}

// 新增课程保存
export function courseSave(params) {
    return axios.post(`${base}/tCurriculumPlan/save`, params)
}

// 删除单条课程
export function riliDel(params) {
    return axios.post(`${base}/tCurriculumPlan/delBatch`, params)
}



/*个人中心*/
export function centerInfo(params) {
    return axios.get(`${base}/personalCenter/find`, params)
}

// 修改个人资料
export function editInfo(params) {
    return axios.post(`${base}/personalCenter/update`, params)
}

// 修改密码
export function updatePass(params) {
    return axios.post(`${base}/personalCenter/update/password`, params)
}

// 修改账号
export function editUserId(params) {
    return axios.post(`${base}/personalCenter/update/account`, params)
}



/*老师调度*/
export function dispatchList(params) {
    return axios.post(`${base}/tTeaDispatch/list`, params)
}

export function dispatchDel(params) {
    return axios.post(`${base}/tTeaDispatch/delBatch`, params)
}

// 调度初始化数据
export function readyDispatch(params) {
    return axios.get(`${base}/tTeaDispatch/initialization`, params)
}

export function dispatchSave(params) {
    return axios.post(`${base}/tTeaDispatch/save`, params)
}

export function dispatchAudit(params) {
    return axios.post(`${base}/tTeaDispatch/update`, params)
}


/* 资源列表+预览*/
export function resourcesList(params) {
    return axios.post(`${base}/tSchResource/list`, params)
}


export function resourcesDel(params) {
    return axios.post(`${base}/tSchResource/delBatch`, params)
}

export function resourcesSave(params) {
    return axios.post(`${base}/tSchResource/save`, params)
}



/* 资源审核 */
// 审核列表
export function topassList(params) {
    return axios.post(`${base}/tAreaResource/list`, params)
}

// 区域管理员审核
export function topassCheck(params) {
    return axios.post(`${base}/tAreaResource/res/sum`, params)
}

// 学校管理员审核
export function shcCheck(params) {
    return axios.post(`${base}/tSchResource/res/sum`, params)
}

// 上下架
export function topassSave(params) {
    return axios.post(`${base}/tAreaResource/save`, params)
}


// 个人上课日志
export function journal(params) {
    return axios.post(`${base}/tTeachingRecord/user/list`, params)
}


// 首页数据展示
export function indexData(params) {
    return axios.get(`${base}/tRolePermission/login/index`, params)
}


/*数据同步*/
// 区域数据
export function syncareauser(params) {
    return axios.get(`${base}/datasnyc/syncareauser`, params)
}

// 学生数据同步
export function syncstu(params) {
    return axios.get(`${base}/datasnyc/syncstu`, params)
}

// 老师数据同步
export function synctea(params) {
    return axios.get(`${base}/datasnyc/synctea`, params)
}